#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void rotate(int* nums, int numsSize, int k) {
    k = k % numsSize;
    int arr[100];
    for (int i = 0; i < k; i++)
    {
        arr[i] = nums[numsSize - k + i];
    }
    int a = 0;
    for (int i = k; i < numsSize; i++)
    {
        arr[i] = nums[a++];
    }
    for (int j = 0; j < numsSize; j++)
    {
        nums[j] = arr[j];
    }
}
int main()
{
	int nums[7] = {1, 2, 3, 4, 5, 6, 7};
	int k = 3;
    int numsize = sizeof(nums) / sizeof(nums[0]);
    rotate(nums, numsize, k);

    return 0;
}